
#include "game_model\headers\game_model_object_factory.hpp"

#include "game_model\headers\game_model_distance_unit.hpp"
#include "game_model\headers\game_model_location.hpp"
#include "game_model\headers\game_model_size.hpp"

#include "game_model\headers\game_model_unmovable_object.hpp"

namespace GameModel {


IObject::Ptr
ObjectFactory::createUnmovableObject( std::shared_ptr< ResourceController::ObjectDescriber > _objectDescriber ) const
{
	std::shared_ptr< IDistanceUnit > horizontalLocation( new DistanceUnit( _objectDescriber->getStartHorizontalLocation() ) );
	std::shared_ptr< IDistanceUnit > verticalLocation( new DistanceUnit( _objectDescriber->getStartVerticalLocation() ) );

	std::shared_ptr< ILocation > location( new Location( horizontalLocation, verticalLocation ) );

	std::shared_ptr< IDistanceUnit > horizontalSize( new DistanceUnit( _objectDescriber->getHorizontalSize() ) );
	std::shared_ptr< IDistanceUnit > verticalSize( new DistanceUnit( _objectDescriber->getVerticalSize() ) );

	std::shared_ptr< ISize > size( new Size( horizontalSize, verticalSize ) );

	return std::shared_ptr< IObject >( new UnmovableObject( location, size, _objectDescriber->getObjectPicture() ) );
}


} // namespace GameModel